/* 
 * StringUtils.java 12.05.2011
 *  
 *  
 * Candidate: Alessandra Otterbach
 * Prometric ID: Algisina1
 * Username: Algisina
 *  
 * Sun Certified Developer for Java 2 Platform, Standard Edition Programming 
 * Assignment (CX-310-252A)
 *  
 * This class is part of the Programming Assignment of the Sun Certified 
 * Developer for Java 2 Platform, Standard Edition certification program, must 
 * not be used out of this context and must be used exclusively by Sun 
 * Microsystems, Inc. 
 */
package suncertify.util;

/**
 * Utility class to check if a String is empty or not empty.
 * 
 * @author Alessandra Otterbach
 * 
 */
public class StringUtils {

    /**
     * Checks if the given String is null or "".
     * 
     * @param string
     *            String to check.
     * @return true, if given String is empty
     */
    public static boolean isEmpty(String string) {
	if (string == null || string.equals("")) {
	    return true;
	}
	return false;
    }

    /**
     * Checks if the given String is not null or not "".
     * 
     * @param string
     *            String to check.
     * @return true, if given String is not empty.
     */
    public static boolean isNotEmpty(String string) {
	if (string != null && !"".equals(string)) {
	    return true;
	}
	return false;
    }
}
